<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layouts/layout">
<head>
<title>Home</title>
</head>
<body>

	<th:block layout:fragment="content">
		<div class="container-wrapper">
			<div class="container">
				<div class="page-header">
					<h1>Edit Product</h1>


					<p class="lead">Please update the product information here:</p>
				</div>

				<form th:object="${product}" th:action="@{/admin/product/editProduct}" method="POST">


					<input type="hidden" th:field="*{id}" />
					<div class="form-group">
						<label for="name">Name</label> <input type="text"
							th:field="*{productName}" class="form-control" />
						<p th:if="${#fields.hasErrors('productName')}"
							th:each="err : ${#fields.errors('productName')}"
							th:errors="*{productName}" th:errorclass="fieldError"
							th:text="${err}"></p>

					</div>



					<div class="form-group">
						<label for="productcategory">Category</label> <label
							class="checkbox-inline"><input type="radio"
							th:field="*{productcategory}" th:value="instrument" />Instrument</label>
						<label class="checkbox-inline"><input type="radio"
							th:field="*{productcategory}" th:value="record" />Record</label> <label
							class="checkbox-inline"><input type="radio"
							th:field="*{productcategory}" th:value="accessory" />Accessory</label>
					</div>



					<div class="form-group">
						<label for="description">Description</label> <input type="text"
							th:field="*{productdescription}" class="form-control" />

					</div>

					<div class="form-group">
						<label for="price">Price</label> <input type="text"
							th:field="*{productprice}" class="form-control" />
						<p th:if="${#fields.hasErrors('productprice')}"
							th:each="err : ${#fields.errors('productprice')}"
							th:errors="*{productprice}" th:errorclass="fieldError"
							th:text="${err}"></p>

					</div>


					<div class="form-group">
						<label for="productcondition">Condition</label> <label
							class="checkbox-inline"><input type="radio"
							th:field="*{productcondition}" th:value="new" />New</label> <label
							class="checkbox-inline"><input type="radio"
							th:field="*{productcondition}" th:value="used" />Used</label>
					</div>

					<div class="form-group">
						<label for="productstatus">Status</label> <label
							class="checkbox-inline"><input type="radio"
							th:field="*{productstatus}" th:value="active" />Active</label> <label
							class="checkbox-inline"><input type="radio"
							th:field="*{productstatus}" th:value="inactive" />Inactive</label>
					</div>

					<div class="form-group">
						<label for="unitInStock">Unit In Stock</label> <input type="text"
							th:field="*{unitinstock}" class="form-control" />
						<p th:if="${#fields.hasErrors('unitinstock')}"
							th:each="err : ${#fields.errors('unitinstock')}"
							th:errors="*{unitinstock}" th:errorclass="fieldError"
							th:text="${err}"></p>
					</div>

					<div class="form-group">
						<label for="manufacturer">Manufacturer</label> <input type="text"
							th:field="*{productmanufacturer}" class="form-control" />

					</div>

					<br /> <br /> <input type="submit" value="submit"
						class="btn btn-default" /> 
						<a	th:href="@{/admin/productInventory}" class="btn btn-default">Cancel</a>

				</form>

			</div>

		</div>
	</th:block>

</body>
</html>